<!--extend index-->
<!--已使用naples bootstrap模板-->

<block_title>表单令牌机制</block_title>

<block_content>
    <h3>防止表单被重复提交</h3>
    <br/>
    {{if !$is_sub}}
    <form action="" method="get" class="form-inline" role="form">

        <div class="form-group">
            <label class="sr-only">label</label>
            <input type="text" class="form-control" name="content"  placeholder="随意输入一些信息 ...">
        </div>

        {{token}}

        <button type="submit" class="btn btn-primary">提交一个表单</button>
    </form>
    <br/>
    {{else}}
    {{if $token_right}}
    <div id="alert1" style="width: 320px;" class="alert alert-success">
        <a href="#alert1" class="close" data-dismiss="alert">&times;</a>
        <strong>成功！</strong>正常提交的表单（按F5试试）。
    </div>
    {{else}}
    <div id="alert2" style="width: 320px;" class="alert alert-warning">
        <a href="#alert2" class="close" data-dismiss="alert">&times;</a>
        <strong>警告！</strong>重复提交的表单。<br><a href="{{url # based}}">刷新本页重新获得令牌</a>
    </div>
    {{/}}
    {{/}}
</block_content>